using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class PhieuKeToanManagement
	{
	
		public ResultObj SaveNewPhieuKeToan(PhieuKeToan phieuketoan)
        		{
			ResultObj result = new ResultObj();
			phieuketoan.Id = -1;
			PhieuKeToanDAO phieuketoanDAO = new PhieuKeToanDAO();
			result = phieuketoanDAO.SavePhieuKeToan(phieuketoan);
			
			return result;
		}
		
		public ResultObj UpdatePhieuKeToan(PhieuKeToan phieuketoan)
        		{
			ResultObj result = new ResultObj();
			PhieuKeToanDAO phieuketoanDAO = new PhieuKeToanDAO();
			result = phieuketoanDAO.SavePhieuKeToan(phieuketoan);
			
			return result;
		}
		
		public ResultObj DeletePhieuKeToan(PhieuKeToan phieuketoan)
        		{
			ResultObj result = new ResultObj();
			PhieuKeToanDAO phieuketoanDAO = new PhieuKeToanDAO();
			result = phieuketoanDAO.DeletePhieuKeToan(phieuketoan);
			
			return result;
		}
		
		public ResultObj GetAllPhieuKeToan( )
        		{
			ResultObj result = new ResultObj();
			PhieuKeToanDAO phieuketoanDAO = new PhieuKeToanDAO();
			result = phieuketoanDAO.GetAllPhieuKeToan();
			
			return result;
		}
		
		public ResultObj GetPhieuKeToanById(PhieuKeToan phieuketoan)
        		{
			ResultObj result = new ResultObj();
			PhieuKeToanDAO phieuketoanDAO = new PhieuKeToanDAO();
			result = phieuketoanDAO.GetAllPhieuKeToanByID(phieuketoan);
			
			return result;
		}
					
	}
}
